import request from '@/utils/request'

// 查询优惠券列表
export function list(pageSize,pageNum) {
    const data = {
        pageSize,
        pageNum,
    }
    return request({
      url: '/goods/coupon/list',
      method: 'get',
      params: data
    })
  }

// 新增优惠券
export function add(data) {
    return request({
      url: '/goods/coupon',
      method: 'post',
      params: data
    })
  }
  // 删除coupon
export function del(id) {
    return request({
      url: '/goods/coupon/'+id,
      method: 'DELETE',
    })
  }
// 修改coupon
export function update(data) {
    return request({
        url: '/goods/coupon',
        method: 'put',
        params: data
    })
    }
   // 查询优惠券详情
   export function coupon(id) {
    return request({
      url: '/goods/coupon/'+id,
      method: 'get',
    })
  }
// 查询优惠券详情
export function inquire(data) {
  return request({
      url: '/goods/coupon/list',
      method: 'get',
      params: data
  })
}